package Events
{
	import Player.SnakeHead;
	
	import flash.events.Event;
	import flash.geom.Point;
	
	/**
	 * Class holding snake events like move, death.
	 */
	public class SnakeChangeEvent extends Event
	{
		public static const HEAD_CHANGE:String = "headChange";
		public static const SNAKE_MOVE:String = "moved";
		public static const SNAKE_DEATH:String = "death";
		
		private var _snake:SnakeHead;
		private var _oldPosition:Point;
		
		public function SnakeChangeEvent(type:String, snake:SnakeHead, position:Point, bubbles:Boolean=false, cancelable:Boolean=false)
		{
			super(type, bubbles, cancelable);
			_snake = snake;
			_oldPosition = position;
		}
		
		public function get snake():SnakeHead{
			return _snake;
		}
		
		public function get oldPosition():Point{
			return _oldPosition;
		}
	}
}